﻿using System;
using System.Collections.Generic;

using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using IP.Core.IPData;
using IP.Core.IPUserService;
using WebDS.CDBNames;
using IP.Core.IPCommon;
using WebUS;
using WebDS;

public partial class DanhMuc_US602_Danh_sach_cong_viec_chua_hoan_thanh : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (Request.QueryString["id_use"] != null)
            {
                m_id_use = CIPConvert.ToDecimal(Request.QueryString["id_use"]);
                load_data_to_grv_cong_viec();
            }            
            else
            {
                US_V_DM_NHAN_VIEN v_us = new US_V_DM_NHAN_VIEN();
                v_us.Get_us_by_ten_truy_cap(Session["UserName"].ToString());
                m_id_use = v_us.dcID;
                load_data_to_grv_cong_viec();
            }
        }
    }

    #region Members
    DS_V_CONG_VIEC_THANH_VIEN m_ds_cong_viec_nv = new DS_V_CONG_VIEC_THANH_VIEN();
    US_V_CONG_VIEC_THANH_VIEN m_us_cong_viec_nv = new US_V_CONG_VIEC_THANH_VIEN();
    decimal m_id_use = 0;
    #endregion

    #region Public Methods

    #endregion

    #region Private Methods


    private void load_data_to_grv_cong_viec()
    {       
        m_us_cong_viec_nv.filldataset_tu_dien_by_user(m_id_use, 38, m_ds_cong_viec_nv);
        if (m_ds_cong_viec_nv.V_CONG_VIEC_THANH_VIEN != null && m_ds_cong_viec_nv.V_CONG_VIEC_THANH_VIEN.Rows.Count > 0)
        {
            m_grv_dm_cong_viec.DataSource = m_ds_cong_viec_nv.V_CONG_VIEC_THANH_VIEN;
            m_grv_dm_cong_viec.DataBind();
        }
    }

    private void load_update_dm_tu_dien(int i_int_row_index)
    {
        try
        {
            decimal v_dc_id_dm_tu_dien = CIPConvert.ToDecimal(m_grv_dm_cong_viec.DataKeys[i_int_row_index].Value);
            US_CM_DM_TU_DIEN v_us_dm_tu_dien = new US_CM_DM_TU_DIEN(v_dc_id_dm_tu_dien);
        }
        catch (Exception v_e)
        {
            throw v_e;
        }
    }
    #endregion

    #region Events


    protected void m_grv_dm_tu_dien_SelectedIndexChanging(object sender, GridViewSelectEventArgs e)
    {
        try
        {
            m_lbl_mess.Text = "";
            load_update_dm_tu_dien(e.NewSelectedIndex);
        }
        catch (Exception v_e)
        {
            throw v_e;
        }
    }
    #endregion
}